---
id: 660f4934fb48f63abd5ae371
title: Step 86
challengeType: 1
dashedName: step-86
---

# --description--

Using `done` to track the number of rows that have been generated is functional, but you can actually clean up the logic a bit further.

Arrays have a special `length` property that allows you to see how many values, or <dfn>elements</dfn>, are in the array. You would access this property using syntax like `myArray.length`.

Update your condition to check if `rows.length` is less than or equal to `count`.

# --hints--

Your `while` loop should check if `rows.length` is less than or equal to `count`.

```js
assert.match(code, /while\s*\(\s*rows\.length\s*<=\s*count\s*\)/);
```

# --seed--

## --seed-contents--

```js
const character = "#";
const count = 8;
const rows = [];

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
  rows.push(padRow(i, count));
}*/

--fcc-editable-region--
let done = 0;

while (done <= count) {
  done++;
  rows.push(padRow(done, count));
}
--fcc-editable-region--

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);
```
